Apparatus for eliminating moire in scanned image and method for the same

ABSTRACT

A method for eliminating moire in scanned digital image comprises the steps of using an average circuit for taking weighted average and error diffusing a gray level difference between an error diffusion pixel G ij  and neighbor pixels to neighbor to obtain output image pixel Y′ ij ; using a second adder for subtracting the error diffusion pixel G ij  from the output image pixel Y′ ij  to obtain a neighbor image error d ij ; using a error filter H(z) to process the neighbor image error d ij  to obtain a corrected pixel error H(d(i,j)); and using a first adder for adding the corrected pixel error H(d(i,j)) and the input image pixel Y ij  to obtain the corrected error diffusion pixel G ij , and then jumping to first step until all pixels being processed. The method provides real time treatment for eliminating moire and provide smooth image.

RELATED APPLICATIONS

This application is a Divisional patent application of co-pendingapplication Ser. No. 10/394,035, filed 24 Mar. 2003.

FIELD OF THE INVENTION

The present invention relates to a method for eliminating moire inscanned image, especially to a method for eliminating moire in multiplefunction printer (MFP) or scanner to obtain better image quality.

BACKGROUND OF THE INVENTION

The multiple function printer (MFP) and scanner play essential role toproduce hot copy image and digital image. To provide image with highfidelity, an image processing software is required to compensate theimage obtained through the MFP and scanner.

FIG. 1 shows a prior art image processing method. The original documentis scanned to obtain digitalized RGB data. The digitalized RGB data issubjected to a CMYK conversion, a half-tone treatment and a graphic-textenhancing treatment to obtain CMYK half-tone image. The CMYK half-toneimage is printed by a printer module. As can be seen from the flowchart,the scanned image is processed by the CMYK conversion, the half-tonetreatment and the graphic-text enhancing treatment to compensate thediscrepancy between scanner and printer.

The half-tone treatment generally adopts order dither and errordiffusion methods. The order dither increases gray level by decreasingthe resolution of image, i.e., increases the coding point in a regionfor a specific color to increase the gray level for this color.

The error diffusion method distributes the error during digitalizing thegray scale image to neighbor pixel. With reference to FIG. 2, the errordiffusion method is implemented by a first adder 11, a quantizer circuit12, a second adder 13 and an error filter 14, wherein X_(ij) is inputimage pixel, U_(ij) is error diffusion pixel, X′_(ij) is output imagepixel, e_(ij) is neighbor image error, H(z) is error filter. The secondadder 13 subtracts the error diffusion pixel U_(ij) from the outputimage pixel X′_(ij) to obtain the neighbor image error e_(ij). Theneighbor image error e_(ij) is processed by the error filter H(z) 14 toobtain a corrected pixel error H(e(i,j)). The first adder 11 subtractsthe corrected pixel error H(e(i,j)) from the input image pixel X_(ij) toobtain the error diffusion pixel U_(ij). It also means that the pixelerror H(e(i,j)) is distributed to the neighbor pixels according tocoefficients type of the error filter H(z). The error diffusion pixelU_(ij) is compared with a threshold t in the quantizer circuit 12 toobtain digitalized output (0 or 1). A digital output 1 is obtained whenthe error diffusion pixel U_(ij) is larger than the threshold t and adigital output 0 is obtained when the error diffusion pixel U_(ij) issmaller than or equal to the threshold t. The error diffusion methoddistributes quantization error to neighbor pixel to compensate errorbetween one pixel and neighbor pixel.

The conventional half-tone treatment such as order dither and errordiffusion methods generally produces moire in scanned image. Therefore,post treatment such as mask method or frequency domain method such asFourier transform is used to reduce the moire in scanned image. Theabout methods become time consuming and complicated when the moirefrequently occur or occupies large area.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide a method for fasteliminating moire in scanned image.

It is another object of the present invention to provide a method foreliminating moire in scanned image, wherein the weight for errordiffusion treatment can be selected according to the complexity ofmoire.

It is still another object of the present invention to provide a methodfor eliminating moire in scanned image, which can perform real timetreatment for MPF arid scanner.

To achieve above object, the present invention provides a method foreliminating moire in scanned image, which comprises following steps:

(a). using an average circuit for taking weighted average and errordiffusing a gray level difference between an error diffusion pixelG_(ij) and neighbor pixels to neighbor pixels to obtain output imagepixel Y′_(ij);

(b). using a second adder for operating the output image pixel Y_(ij)and the error diffusion pixel G_(ij) to obtain a neighbor image errord_(ij);

(c). using an error filter H(z) to process the neighbor image errord_(ij) to obtain a corrected pixel error H(d(i,j)); and

(d). using a first adder for operating the corrected pixel errorH(d(i,j)) and the input image pixel Y_(ij) to obtain the corrected errordiffusion pixel G_(ij), and then jumping to step (a) until all pixelsbeing processed.

To achieve above object, the present invention provides an apparatus foreliminating moire in scanned image, which comprises: a first adder forinputting an image pixel, an average circuit to take weighted averagefor the image pixel and the neighbor pixels thereof, a second adder toadd the output of the first adder and the average circuit to obtain aneighbor image error, and an error filter to distribute the gray leveldifference of the image pixel to neighbor pixels and then outputs to thefirst adder; wherein the first adder, operates the output of the errorfilter and the input image pixel to obtain the corrected image pixel.The average circuit takes average for neighbor corrected image pixel toobtain a corrected output image pixel.

The various objects and advantages of the present invention will be morereadily understood from the following detailed description when read inconjunction with the appended drawing, in which:

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 shows a flowchart of prior art treatment for color printing;

FIG. 2 shows a block diagram of prior art error diffusion treatment;

FIG. 3 shows a block diagram for implementing the method according tothe present invention;

FIG. 4 shows a flowchart of method for eliminating moire in scannedimage according to the present invention; and

FIG. 5 is a schematic diagram for demonstrating the treatment of thepresent invention.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 3 shows a block diagram of a system for implementing the method foreliminating moire in digital image according to the present invention.The system comprises a first adder 21, an average circuit 22, a secondadder 23 and an error filter 24, wherein Y_(ij) is input image pixel,G_(ij) is error diffusion pixel, Y″_(ij) is output image pixel, d_(ij)is neighbor image error.

The average circuit 22 diffuses the gray level difference to neighborpixels instead of outputting binary value. The average circuit 22 takesweighted average for neighbor pixels to obtain output image pixelY′_(ij). The second adder 23 subtracts the error diffusion pixel G_(ij)from the output image pixel Y′_(ij) to obtain the neighbor image errord_(ij). The neighbor image error d_(ij) is processed by the error filterH(d) 24 to obtain a corrected pixel error H(e(i,j)).

The error filter H(d) distributes error to neighbor pixels according tofollowing formula:H(d)={d.times.w _(i) +p,j+q.vertline.p=−n1,−n1+1, . . . ,n1′−1,n1′andq=−n2,−n2+1, . . . , n2′−1,n2′},

wherein n1, n1′, n2, n2′ is natural number, and .SIGMA.w_(i)+p,j+q=1.

The first adder 21 subtracts the corrected pixel error H(d(i,j)) fromthe input image pixel Y_(ij) to obtain the corrected error diffusionpixel G_(ij). The average circuit 22 takes weighted average for thecorrected error diffusion pixel G_(ij) and the neighbor pixels to obtainoutput image pixel Y′_(ij). The average circuit 22 processes each pixelin an image to be processed.

With reference to FIGS. 4 and 5, the image data in FIG. 5 is segmentedto a plurality of lines and processed by the method shown in FIG. 3. Theimage shown in FIG. 5 is divided into a plurality of lines and the imageis subjected to line-based treatment, wherein the image data has width n(represented by variable i) and height m (represented by variable j)

The process comprises following steps:

Step 31: processing from a beginning pixel i of a line of image;

Step 32: the average circuit 22 calculating the weighted average forneighbor pixels to obtain Avg(i,j); 1 Avg (i,j)=Avg (i,j−1) times.Weight ij+G (i,j) Weight ij+1

Step 33: judging whether Avg(i,j) is larger than white digital count(for 8-bit image, white digital count is 255), if true, going to step35, else going to step 34;

Step 34: judging whether Avg(i,j) is less than black digital count (for8-bit image, black digital count is 0), if true, going to step 36, elsegoing to step 37;

Step 35: outputting the output image pixel Y′_(ij) with value of whitedigital count;

Step 36: outputting the output image pixel Y′_(ij) with value of blackdigital count;

Step 37: outputting the output image pixel Y′_(ij) with Avg(i,j);

Step 38: the second adder 23 subtracting the error diffusion pixelG_(ij) from the output image pixel Y′_(ij) to obtain the neighbor imageerror d_(ij);

Step 39: the first adder 21 subtracting the corrected pixel errorH(d(i,j)) from the input image pixel Y_(ij) to obtain the correctederror diffusion pixel G_(ij);

Step 40: judging whether the beginning pixel i reaches the end of theline (i is larger than the image width n); if true, going to step 42,else going to step 41;

Step 41: adding 1 to i and returning to step 32 for processing nextpixel;

Step 42: obtaining the average for pixels within a line length 2 L+1 toget an average value Avg′(i,j) for all pixels along the line, 2Avg′(i,j)={K=−L L Y′(i+k,j)} (2 L+1)

wherein k is an incremental variable, L is the length for taking Gausssmoothing for right and left side pixel(s) of the pixel at position i,the maximal value of L is half of image width. To prevent fuzzy image, Lis preferably 1-3.

then using the Avg(i,j) as reference value for the average circuit 22for next line and then going to step 43;

Step 43: judging whether j reaches the bottom line of image (j is largerthan the image height m); if true, ending the process, else going tostep 44;

Step 44: adding l to j and processing image of next line.

As can be seen from above description, the method according to thepresent invention distributes the gray level difference of one pixel toneighbor pixels by a weight distribution according to the coefficientsof the type of error filter. When a plurality of lines of image are sentto a buffer during a scanning operation of an MFP or a scanner, a systemimplemented by the method according to the present invention can processthe lines of image stored in the buffer and then save the processedresult in the buffer. The process according to the present invention isfinished after the scanning operation is ended. The inherent moire inconventional half-tone treatment can be eliminated and smooth image canbe obtained.

To sum up, the method for eliminating moire in scanned digital imageaccording to the present invention has following advantages:

1. The weight for error diffusion treatment can be selected according tothe complexity of moire. The eliminating effect is more prominent asweight is increased.

2. The method according to the present invention can perform real timetreatment for MPF and scanner.

Although the present invention has been described with reference to thepreferred embodiment thereof, it will be understood that the inventionis not limited to the details thereof. Various substitutions andmodifications have suggested in the foregoing description, and otherwill occur to those of ordinary skill in the art. Therefore, all suchsubstitutions and modifications are intended to be embraced within thescope of the invention as defined in the appended claims.

1. An apparatus for eliminating moire in scanned digital image,comprising: a first adder for inputting an image pixel; an averagecircuit to take weighted average for the image pixel and neighbor pixelsthereof; a second adder to add an output of the first adder and theaverage circuit to obtain a neighbor image error; and an error filter todistribute a gray level difference of the image pixel to neighbor pixelsand then output to the first adder; wherein the first adder operates theoutput of the error filter and the input image pixel to obtain thecorrected image pixel, the average circuit takes average for neighborcorrected image pixel to obtain a corrected output image pixel.